package cn.explink.dop.entity.vo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import cn.explink.dop.enums.DeliveryCompanyEnum;

/**
 *
 * @ClassName: DeliveryCompanyVO
 * @Description: 配送公司信息表
 * @author 孟凡岭
 * @date 2015年5月25日 下午5:14:29
 * @since AR1.0
 */
@Entity
@Table(name = "bd_deliverycompany")
public class DeliveryCompanyVO implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 7506997726447633461L;
	/**
	 * 主键
	 */
	private String id;
	/**
	 * 公司名称
	 */
	private String companyName;
	/**
	 * 公司电话
	 */
	private String companyTel;
	/**
	 * 备注
	 */
	private String companyDesc;
	/**
	 * 员工数量
	 */
	private int employeeNum;
	/**
	 * 状态 1：启用，2：停用，3：删除
	 */
	private int status;
	
	private Integer deliverycompanyid;

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "id", nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "company_Name")
	public String getCompanyName() {
		return this.companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "company_Desc", columnDefinition = "varchar(600)")
	public String getCompanyDesc() {
		return this.companyDesc;
	}

	public void setCompanyDesc(String companyDesc) {
		this.companyDesc = companyDesc;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(columnDefinition = "int default 1")
	public int getStatus() {
		return this.status;
	}

	@Column(name = "company_Tel")
	public String getCompanyTel() {
		return this.companyTel;
	}

	public void setCompanyTel(String companyTel) {
		this.companyTel = companyTel;
	}

	@Column(name = "employee_Num", columnDefinition = "int default 0")
	public int getEmployeeNum() {
		return this.employeeNum;
	}

	public void setEmployeeNum(int employeeNum) {
		this.employeeNum = employeeNum;
	}

	@Column(name = "deliverycompany_id")
	public Integer getDeliverycompanyid() {
		return deliverycompanyid;
	}

	public void setDeliverycompanyid(Integer deliverycompanyid) {
		this.deliverycompanyid = deliverycompanyid;
	}

	@Transient
	public String getStatusText() {
		List<DeliveryCompanyEnum> list = DeliveryCompanyEnum.getAllStatus();
		for (int i = 0; i < list.size(); i++) {
			DeliveryCompanyEnum en = list.get(i);
			if (this.getStatus() == en.getValue()) {
				return en.getText();
			}
		}
		return "";
	}

	public static long getSerialversionuid() {
		return DeliveryCompanyVO.serialVersionUID;
	}

}
